import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

//dart示例化是可以不用new关键字！！！
//自定义组件
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // App的根组件，一般的APP初始结构都是这样
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('First Web'),
        ),
        body: HomeContent(),
      ),
      theme: ThemeData(primaryColor: Colors.blue),
    );
  }
}

//body内容组件
class HomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Center(
      child: new Text(
        "二次封装自定义组件",
        style: TextStyle(fontSize: 50.0, color: Colors.purple),
        textDirection: TextDirection.ltr,
      ),
    );
  }
}
